<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AIfES 2: aiopti_sgd Struct Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="AIfES_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AIfES 2
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('structaiopti__sgd.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-attribs">Data Fields</a>  </div>
  <div class="headertitle">
<div class="title">aiopti_sgd Struct Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>General <a class="el" href="aiopti__sgd_8h.html">Stochastic Gradient Descent (SGD) optimizer </a> struct.  
 <a href="structaiopti__sgd.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="aiopti__sgd_8h_source.html">aiopti_sgd.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Data Fields</h2></td></tr>
<tr class="memitem:a76e9fa4cf381a685a5df819a57737e64"><td class="memItemLeft" align="right" valign="top"><a id="a76e9fa4cf381a685a5df819a57737e64"></a>
<a class="el" href="structaiopti.html">aiopti_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structaiopti__sgd.html#a76e9fa4cf381a685a5df819a57737e64">base</a></td></tr>
<tr class="memdesc:a76e9fa4cf381a685a5df819a57737e64"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inherited field members from general optimizer struct. <br /></td></tr>
<tr class="separator:a76e9fa4cf381a685a5df819a57737e64"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Optimizer configuration</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>Required configuration parameters for the optimizer</p>
<p>These fields have to be configured by the user before calling the initializer function. </p>
</div></td></tr>
<tr class="memitem:a4be2a7d03bb9aeca3a064739b167098a"><td class="memItemLeft" align="right" valign="top"><a id="a4be2a7d03bb9aeca3a064739b167098a"></a>
void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structaiopti__sgd.html#a4be2a7d03bb9aeca3a064739b167098a">momentum</a></td></tr>
<tr class="memdesc:a4be2a7d03bb9aeca3a064739b167098a"><td class="mdescLeft">&#160;</td><td class="mdescRight">aiscalar: Momentum(set to null to save optimization memory) <br /></td></tr>
<tr class="separator:a4be2a7d03bb9aeca3a064739b167098a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader">Math functions</div></td></tr>
<tr><td colspan="2"><div class="groupText"><p>Required data type specific math functions </p>
</div></td></tr>
<tr class="memitem:a5f5b55cad6c306233a8e4510d1773244"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structaiopti__sgd.html#a5f5b55cad6c306233a8e4510d1773244">tensor_sub</a> )(const <a class="el" href="structaitensor.html">aitensor_t</a> *a, const <a class="el" href="structaitensor.html">aitensor_t</a> *b, <a class="el" href="structaitensor.html">aitensor_t</a> *result)</td></tr>
<tr class="memdesc:a5f5b55cad6c306233a8e4510d1773244"><td class="mdescLeft">&#160;</td><td class="mdescRight">Required math function: Element wise tensor subtraction.  <a href="structaiopti__sgd.html#a5f5b55cad6c306233a8e4510d1773244">More...</a><br /></td></tr>
<tr class="separator:a5f5b55cad6c306233a8e4510d1773244"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7674445f16490c6cacdb03157feab8c7"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structaiopti__sgd.html#a7674445f16490c6cacdb03157feab8c7">tensor_add</a> )(const <a class="el" href="structaitensor.html">aitensor_t</a> *a, const <a class="el" href="structaitensor.html">aitensor_t</a> *b, <a class="el" href="structaitensor.html">aitensor_t</a> *result)</td></tr>
<tr class="memdesc:a7674445f16490c6cacdb03157feab8c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Required math function: Element wise tensor addition.  <a href="structaiopti__sgd.html#a7674445f16490c6cacdb03157feab8c7">More...</a><br /></td></tr>
<tr class="separator:a7674445f16490c6cacdb03157feab8c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cbbfaac40611a8dd0ec908cc199b388"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structaiopti__sgd.html#a2cbbfaac40611a8dd0ec908cc199b388">scalar_mul</a> )(const void *scalar, const <a class="el" href="structaitensor.html">aitensor_t</a> *a, <a class="el" href="structaitensor.html">aitensor_t</a> *result)</td></tr>
<tr class="memdesc:a2cbbfaac40611a8dd0ec908cc199b388"><td class="mdescLeft">&#160;</td><td class="mdescRight">Required math function: Multiplication of a scalar with a tensor.  <a href="structaiopti__sgd.html#a2cbbfaac40611a8dd0ec908cc199b388">More...</a><br /></td></tr>
<tr class="separator:a2cbbfaac40611a8dd0ec908cc199b388"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0c5520df9a1bfa236b1ef7eddeb3553"><td class="memItemLeft" align="right" valign="top">void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structaiopti__sgd.html#aa0c5520df9a1bfa236b1ef7eddeb3553">zero_tensor</a> )(<a class="el" href="structaitensor.html">aitensor_t</a> *tensor)</td></tr>
<tr class="memdesc:aa0c5520df9a1bfa236b1ef7eddeb3553"><td class="mdescLeft">&#160;</td><td class="mdescRight">Required math function: Sets the elements of a tensor to zero.  <a href="structaiopti__sgd.html#aa0c5520df9a1bfa236b1ef7eddeb3553">More...</a><br /></td></tr>
<tr class="separator:aa0c5520df9a1bfa236b1ef7eddeb3553"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>General <a class="el" href="aiopti__sgd_8h.html">Stochastic Gradient Descent (SGD) optimizer </a> struct. </p>
</div><h2 class="groupheader">Field Documentation</h2>
<a id="a2cbbfaac40611a8dd0ec908cc199b388"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2cbbfaac40611a8dd0ec908cc199b388">&#9670;&nbsp;</a></span>scalar_mul</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* scalar_mul) (const void *scalar, const <a class="el" href="structaitensor.html">aitensor_t</a> *a, <a class="el" href="structaitensor.html">aitensor_t</a> *result)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Required math function: Multiplication of a scalar with a tensor. </p>
<p>Requires a math function that multiplies a scalar with a tensor:<br  />
 </p><p class="formulaDsp">
\[ result = scalar \cdot a \]
</p>
 
</div>
</div>
<a id="a7674445f16490c6cacdb03157feab8c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7674445f16490c6cacdb03157feab8c7">&#9670;&nbsp;</a></span>tensor_add</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* tensor_add) (const <a class="el" href="structaitensor.html">aitensor_t</a> *a, const <a class="el" href="structaitensor.html">aitensor_t</a> *b, <a class="el" href="structaitensor.html">aitensor_t</a> *result)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Required math function: Element wise tensor addition. </p>
<p>Requires a math function that adds two tensors element wise:<br  />
 </p><p class="formulaDsp">
\[ result = a + b \]
</p>
 
</div>
</div>
<a id="a5f5b55cad6c306233a8e4510d1773244"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5f5b55cad6c306233a8e4510d1773244">&#9670;&nbsp;</a></span>tensor_sub</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* tensor_sub) (const <a class="el" href="structaitensor.html">aitensor_t</a> *a, const <a class="el" href="structaitensor.html">aitensor_t</a> *b, <a class="el" href="structaitensor.html">aitensor_t</a> *result)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Required math function: Element wise tensor subtraction. </p>
<p>Requires a math function that subtracts two tensors element wise:<br  />
 </p><p class="formulaDsp">
\[ result = a - b \]
</p>
 
</div>
</div>
<a id="aa0c5520df9a1bfa236b1ef7eddeb3553"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0c5520df9a1bfa236b1ef7eddeb3553">&#9670;&nbsp;</a></span>zero_tensor</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void(* zero_tensor) (<a class="el" href="structaitensor.html">aitensor_t</a> *tensor)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Required math function: Sets the elements of a tensor to zero. </p>
<p>Requires a math function that sets the elements of the given tensor to zero (or to the zero_point):<br  />
 </p><p class="formulaDsp">
\[ tensor_i = 0 \]
</p>
 
</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="aiopti__sgd_8h_source.html">aiopti_sgd.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="structaiopti__sgd.html">aiopti_sgd</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
